

<!doctype html>
<html ng-app="docsSimpleDirective">
<head>
    <script src="http://code.angularjs.org/1.2.25/angular.min.js"></script>
</head>
<body>
<div ng-controller="Ctrl">
    <div my-customer></div>
</div>
</body>
<script type="text/javascript">
    angular.module('docsSimpleDirective', [])
        .controller('Ctrl', function($scope) {
            $scope.customer = {
                name: 'Naomi',
                address: '1600 Amphitheatre'
            };
        })
        .directive('myCustomer', function() {
            return {
                template: '姓名: {{customer.name}} 地址: {{customer.address}}'
            };
        });
</script>
</html>

